package lesson15;

public class CarShop {
	Car[] cars;
	int currentCar=0;
	CarShop(int capacity){
		cars = new Car[capacity];
		
	}
	boolean addCar(Car car){
		for(int i = 0; i< cars.length; i++){
			if(cars[i]==null){
				cars[i]= car;
				return true;
			}
		}
		return false;
	}
	Car getNextCar(){
		return cars[currentCar+1];
	}
	
	void removeCar(Car car){
		for (int i = 0; i < cars.length; i++) {
			if(cars[i].regNumber.equals(car.regNumber)){
				cars[i]=null;
			}
		}
	}
	void showAllCars(){
		
	}
}
